package P1线性结构.LeetCode链表;

public class LC328 {
    public ListNode oddEvenList(ListNode head) {
        if (head == null || head.next == null) {
            return head;
        }
        ListNode ji = head;
        ListNode ou = head.next;
        ListNode ouHead = ou;
        while (ou != null && ou.next != null) {
            ji.next = ji.next.next;
            ou.next = ou.next.next;
            ji = ji.next;
            ou = ou.next;
        }
        ji.next = ouHead;
        return head;
    }
}